package com.cysoft.starter.repeat.core.properties;

import com.cysoft.starter.repeat.core.enums.CacheTypeEnum;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @author 玖零
 * @version V0.0.1
 * @project cysoft-spring-boot-starter-repeat
 * @package com.cysoft.starter.repeat.core.properties
 * @date 2025-03-02 14:55
 * @desc
 */
@Data
@ConfigurationProperties(prefix = "cysoft.repeat")
public class RepeatSubmitProperties {

    /**
     * 是否开启防重复提交 默认开启
     */
    private Boolean enabled = true;

    /**
     * 默认防重复提交存储方式 local
     */
    private CacheTypeEnum cacheType = CacheTypeEnum.LOCAL;

    /**
     * 默认过期时间60S
     */
    private long expireTime = 60;

    /**
     * 默认 毫秒
     */
    private TimeUnit timeUnit = TimeUnit.MILLISECONDS;


    /**
     * 防止重复提交的地址,如果不通过注解的方式可以通过此处进行批量添加
     */
    private List<String> urls;


    /**
     * 唯一标识:一般采取token为主,如果是token则传递获取token的key 非必填
     */
    private String uniqueIdentification;



}
